﻿namespace KinonekoSoftware.CodariaDB.Runtimes.Maintainers
{
    public abstract class RepositoryMaintainer : IRepositoryMaintainer
    {
        
        public static void ChangeType(BsonDocument document, Type type)
        {
            document["_type"] = FallbackSupportTypeBinder.GetNameImpl(type);
        }
        
        /// <summary>
        /// 
        /// </summary>
        /// <param name="repository"></param>
        public abstract void Maintain(IRepository repository);
        
        /// <summary>
        /// 
        /// </summary>
        /// <param name="repository"></param>
        /// <returns></returns>
        public abstract bool NeedMaintain(IRepository repository);
    }
}